package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@RestController
@RequestMapping("/letters")
//私信功能控制器
public class LetterController {
    @Autowired
    private IUserService userService;

    //发起私信会话的接口
    @GetMapping("/{myId}/{youId}")
    private Object postMessage(@PathVariable Long myId,@PathVariable Long youId){
        //开启会话前的准备,获取双方的用户信息
        User user1 = userService.selectById(myId);
        User user2 = userService.selectById(youId);
        HashMap<String , Object> map = new HashMap<>();
        map.put("user1",user1);
        map.put("user2",user2);
        return map;
    }
}
